package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.QuestionBank;
import com.ruoyi.system.mapper.QuestionBankMapper;
import com.ruoyi.system.service.IQuestionBankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class IQuestionBankServiceImpl implements IQuestionBankService {
    @Autowired
    private QuestionBankMapper questionBankMapper;
    @Override
    public List<QuestionBank> selectQuestionBankList(QuestionBank questionBank) {
        return questionBankMapper.selectQuestionBankList(questionBank);
    }

    @Override
    public int insertQuestionBank(QuestionBank questionBank) {
        return questionBankMapper.addBank(questionBank);
    }

    @Override
    public int deleteBankById(Long bankId) {
        return questionBankMapper.deleteQuestionBankByBankId(bankId);
    }

    @Override
    public int updateBank(QuestionBank questionBank) {
        questionBank.setUpdateTime(new Date());
        return questionBankMapper.updateBank(questionBank);
    }

    @Override
    public int deleteBankByIds(Long[] bankIds) {
        return questionBankMapper.deleteQuestionBankByBankIds(bankIds);
    }
}
